#include "ThreadManager.h"

CThreadManager::CThreadManager()
	//pCountNum(NULL)
	:pLoadFullFile(NULL)
	,pLoadPkgFile(NULL)
{

}

CThreadManager::~CThreadManager()
{
}

void CThreadManager::setWorkerNum(int iNum)
{
	SetWorkerNum(iNum);
	InitWorkers();
}

void CThreadManager::init()
{	
	//pCountNum = new CTestCountNum(this, COUNT_NUM);
	pLoadFullFile = new CTestLoadFullFile(this, LOAD_FULL_FILE);
	pLoadPkgFile = new CTestLoadPkgFile(this, LOAD_PKG_FILE);

	//pushThreadHandler(COUNT_NUM, pCountNum);
	pushThreadHandler(LOAD_FULL_FILE, pLoadFullFile);
	pushThreadHandler(LOAD_PKG_FILE, pLoadPkgFile);
}

void CThreadManager::start()
{
	init();

	CreateThreadModel();
}

void CThreadManager::stop()
{
	StopWorkers();

	DestroyThreadModel();
}
